﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing.border {
    import flash.display.*;
    import org.aswing.*;
    import org.aswing.geom.*;
    import org.aswing.graphics.*;

    public class LineBorder extends DecorateBorder {

        private var color:ASColor;
        private var thickness:Number;
        private var round:Number;

        public function LineBorder(_arg1:Border=null, _arg2:ASColor=null, _arg3:Number=1, _arg4:Number=0){
            super(_arg1);
            if (_arg2 == null){
                _arg2 = ASColor.BLACK;
            };
            this.color = _arg2;
            this.thickness = _arg3;
            this.round = _arg4;
        }
        override public function updateBorderImp(_arg1:Component, _arg2:Graphics2D, _arg3:IntRectangle):void{
            var _local4:Number = this.thickness;
            if (this.round <= 0){
                _arg2.drawRectangle(new Pen(this.color, this.thickness), (_arg3.x + (_local4 / 2)), (_arg3.y + (_local4 / 2)), (_arg3.width - _local4), (_arg3.height - _local4));
            } else {
                _arg2.fillRoundRectRingWithThickness(new SolidBrush(this.color), _arg3.x, _arg3.y, _arg3.width, _arg3.height, this.round, _local4);
            };
        }
        override public function getBorderInsetsImp(_arg1:Component, _arg2:IntRectangle):Insets{
            var _local3:Number = Math.ceil(((this.thickness + this.round) - (this.round * 0.707106781186547)));
            return (new Insets(_local3, _local3, _local3, _local3));
        }
        override public function getDisplayImp():DisplayObject{
            return (null);
        }
        public function getColor():ASColor{
            return (this.color);
        }
        public function setColor(_arg1:ASColor):void{
            this.color = _arg1;
        }
        public function getThickness():Number{
            return (this.thickness);
        }
        public function setThickness(_arg1:Number):void{
            this.thickness = _arg1;
        }
        public function getRound():Number{
            return (this.round);
        }
        public function setRound(_arg1:Number):void{
            this.round = _arg1;
        }

    }
}//package org.aswing.border 
